package edu.tgc.entity.student;

import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

import com.fasterxml.jackson.annotation.JsonIgnore;

import edu.tgc.entity.hrm.IdCade;
import edu.tgc.entity.hrm.dictionary.HrmEmployeeStatus;
import edu.tgc.entity.system.BaseAuditableDateEntity;
@Entity
public class TbStudent extends BaseAuditableDateEntity {
	//身份证
	@JsonIgnore
	private IdCade cade;
	//学号
	private String stuNo;
	//班级
	private TbClass banji;
	//职务
	private String duty;
	//QQ
	private String qq;
	//地址
	private String address;
	//电话
	private String phone;
	//是否在校
	private HrmEmployeeStatus status;
	private Integer isUsed=1; //0:否，1：是
	public TbStudent() {
		super();
	}
	public TbStudent(UUID id) {
		super(id);
	}
	@ManyToOne
	public IdCade getCade() {
		return cade;
	}
	public void setCade(IdCade cade) {
		this.cade = cade;
	}
	@ManyToOne
	public TbClass getBanji() {
		return banji;
	}
	public void setBanji(TbClass banji) {
		this.banji = banji;
	}
	@Column(length=30)
	public String getDuty() {
		return duty;
	}
	public void setDuty(String duty) {
		this.duty = duty;
	}
	@Column(length=20)
	public String getQq() {
		return qq;
	}
	public void setQq(String qq) {
		this.qq = qq;
	}
	@Column(length=100)
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	@Column(length=50)
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	@Transient
	public String getName(){
		return getCade()==null?null:getCade().getName();
	}
	@Transient
	public String getIdNo(){
		return getCade()==null?null:getCade().getIdNo();
	}
	public Integer getIsUsed() {
		return isUsed;
	}
	public void setIsUsed(Integer isUsed) {
		this.isUsed = isUsed;
	}
	@Column(length=20)
	public String getStuNo() {
		return stuNo;
	}
	public void setStuNo(String stuNo) {
		this.stuNo = stuNo;
	}
	@Transient
	public String getSex(){
		return getCade()==null?"":getCade().getSex();
	}
	@Transient
	public String getNation(){
		return getCade()==null?"":getCade().getNation();
	}
	
	@ManyToOne
	public HrmEmployeeStatus getStatus() {
		return status;
	}
	public void setStatus(HrmEmployeeStatus status) {
		this.status = status;
	}
	
	
}
